
library(foreign)

data <- read.dta("CCL_Law_Data_Ver1.dta")
dim(data)
names(data)
######################################################
#### Authority - Anti-Trust Agency #############
######################################################

############ Number of Countries #########

data.x <- data[data$regional_group==0,]
data.x <- data.x[data.x$year>=1900,]
data.x <- data.x[data.x$year<=2010,]
data.x$law_in_place[data.x$country =="Botswana" & data.x$year>=2009] <- 1
data.x$law_in_place[data.x$country =="Dominican Republic" & data.x$year>=2008] <- 1

test <- table(data.x$year, data.x$competition_law_in_place)

test0<- c(1900:2010)
test2 <- test[,2]

y.axis <- c(25,50,75,100,125,150)
Y <- c("25","50","75","100","125","150")

x.axis <- c(1950,1960,1970,1980,1990,2000,2010)
X <- c("1950","1960","1970","1980","1990","2000","2010")

par(mar=c(4, 4, 1, 4),mfrow=c(1,1),family = "serif",oma = c(1,1,1,1))
plot(test0, test2,ylab="# of Countries",xlab="Year",ylim=c(0,150),type="l",col="blue",lwd=3,main="",bty="l",axes=FALSE,font=5,cex=5)
title(main=NA,outer=T)
axis(side=1,at=seq(1900,2010,10),lwd=3,cex=2)
axis(side=2,at=seq(0,150,25),lwd=3,cex=2)

rect(1975, -10, 1979, 150, col= rgb(0,0,1.0,alpha=0.5))


points(x=  1975   , y=39, pch=19,col="blue",lwd=5)
points(x=  1979   , y=41, pch=19,col="blue",lwd=5)
# points(x=  2000   , y=98, pch=19,col="blue",lwd=5)
points(x=  2010  , y=127, pch=19,col="blue",lwd=5)

text(1971,46,labels=c("39"),cex=1.5,col="blue")
text(1983,48,labels=c("41"),cex=1.5,col="blue")
# text(1996,98,labels=c("98"),cex=1.5,col="blue")
text(2007,133,labels=c("127"),cex=1.5,col="blue")

text(1951, 100, "The Height of the \n Chicago School",cex = 2,col= rgb(0,0,1.0,alpha=0.5))
